/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dbo;

/**
 *
 * @author bi
 */
public class Player {

    private String name;
    public Faction faction;
    private float requisition;
    private String controller;

    /**
     * Constructor for comparison, use this for comparison ONLY
     * 
     * @param name: compare name
     */
    public Player(String name) {
        this.name = name;
    }

    public Player(String name, Faction faction, float requisition, String controller) {
        this.name = name;
        this.faction = faction;
        this.requisition = requisition;
        this.controller = controller;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param faction the faction to set
     */
    public void setFaction(Faction faction) {
        this.faction = faction;
    }

    /**
     * @return the requisition
     */
    public float getRequisition() {
        return requisition;
    }

    /**
     * @param requisition the requisition to set
     */
    public void setRequisition(float requisition) {
        this.requisition = requisition;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj.getClass().equals(this.getClass())) {
            if (this.hashCode() == obj.hashCode()) {
                return true;
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 41 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return name;
    }

    /**
     * @return the controller
     */
    public String getController() {
        return controller;
    }
}
